from odoo import fields, models, api


class SMaterialCodingAttributeLine(models.Model):
    _name = 's.material.coding.attribute.line'
    _description = '产品属性校验条件'

    rule_id = fields.Many2one('product.replace.rule', string='产品替换规则')
    domain = fields.Char(string='筛选条件')
    product_attributes = fields.Many2one('sb.material.coding.attribute', string='产品属性')
    allow_range = fields.Float(string='误差范围(%)', default=0)
    type = fields.Selection([
        ('disable', '禁用'),
        ('warning', '预警'),
    ], string='校验方式', default='disable')